﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Text.RegularExpressions;

namespace SN.Report
{
    public partial class FormAutoAddFormula : Form
    {
        public FormTemp FrmTemp;
        public FormAutoAddFormula()
        {
            InitializeComponent();
        }

        private void FormAutoAddFormula_Load(object sender, EventArgs e)
        {

        }

        private void button1_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(_x.Text) || !Regex.IsMatch(_x.Text, @"^[-]?[0-9]*$"))
            {
                MessageBox.Show("偏移行位置不正确，请输入正确的数值！");
                return;
            }
            if (string.IsNullOrEmpty(_y.Text) || !Regex.IsMatch(_y.Text, @"^[-]?[0-9]*$"))
            {
                MessageBox.Show("偏移行位置不正确，请输入正确的数值！");
                return;
            }
            if(string.IsNullOrEmpty(_formula.Text))
            {
                MessageBox.Show("请输入应用公式！");
                return;
            }

            
            FrmTemp._x=Convert.ToInt32( _x.Text);
            FrmTemp._y=Convert.ToInt32(_y.Text);
            FrmTemp.AutoAddFormula = _formula.Text.Trim();


            Close();
        }


       
    }
}
